export function codeQualityAuthorDetail(data) {
  let temp = Math.max(...data.y);
  let max = temp > 10 ? (temp / 10) * 10 : 10;
  if (Number.isNaN(max)) {
    max = 10;
  }
  // let intervalVal = Math.round(max / 5);
  // console.log("max : " + max);

  let option = {
    tooltip: {
      trigger: 'axis',
      axisPointer: {
        type: 'cross',
        crossStyle: {
          color: '#999',
        },
      },
    },
    // legend: {
    //     data: [
    //         '异味数',
    //         ],
    //     top: 'bottom'
    //
    // },
    xAxis: [
      {
        type: 'category',
        data: data.x,
        axisPointer: {
          type: 'shadow',
        },
      },
    ],
    yAxis: [
      {
        type: 'value',
        name: '个',
        min: 0,
        max: max,
        interval: 100,
        axisLabel: {
          formatter: '{value}',
        },
      },
    ],
    series: [
      {
        name: data.desc,
        type: 'line',
        itemStyle: { color: '#FF9966' },
        data: data.y,
      },
      {
        name: data.desc,
        type: 'bar',
        itemStyle: { color: '#66CCFF' },
        data: data.y,
      },
    ],
  };
  return option;
}
